<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Module ibrowse</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module ibrowse</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>The ibrowse application implements an HTTP 1.1 client in erlang.
<p>Copyright © 2005-2014 Chandrashekhar Mullaparthi</p>

<p><b>Behaviours:</b> <a href="gen_server.html"><tt>gen_server</tt></a>.</p>
<p><b>Authors:</b> Chandrashekhar Mullaparthi (<a href="mailto:chandrashekhar dot mullaparthi at gmail dot com"><tt>chandrashekhar dot mullaparthi at gmail dot com</tt></a>).</p>

<h2><a name="description">Description</a></h2><p>The ibrowse application implements an HTTP 1.1 client in erlang. This  
module implements the API of the HTTP client. There is one named  
process called 'ibrowse' which assists in load balancing and maintaining configuration. There is one load balancing process per unique webserver. There is  
one process to handle one TCP connection to a webserver  
(implemented in the module ibrowse_http_client). Multiple connections to a  
webserver are setup based on the settings for each webserver. The  
ibrowse process also determines which connection to pipeline a  
certain request on.  The functions to call are send_req/3,  
send_req/4, send_req/5, send_req/6.</p>
 
  <p>Here are a few sample invocations.</p>
 
  <code>
  ibrowse:send_req("http://intranet/messenger/", [], get).
  <br><br>
 
  ibrowse:send_req("http://www.google.com/", [], get, [],
                [{proxy_user, "XXXXX"},
                 {proxy_password, "XXXXX"},
                 {proxy_host, "proxy"},
                 {proxy_port, 8080}], 1000).
  <br><br>
 
 ibrowse:send_req("http://www.erlang.org/download/otp_src_R10B-3.tar.gz", [], get, [],
                [{proxy_user, "XXXXX"},
                 {proxy_password, "XXXXX"},
                 {proxy_host, "proxy"},
                 {proxy_port, 8080},
                 {save_response_to_file, true}], 1000).
  <br><br>
 
  ibrowse:send_req("http://www.erlang.org", [], head).
 
  <br><br>
  ibrowse:send_req("http://www.sun.com", [], options).
 
  <br><br>
  ibrowse:send_req("http://www.bbc.co.uk", [], trace).
 
  <br><br>
  ibrowse:send_req("http://www.google.com", [], get, [],
                    [{stream_to, self()}]).
  </code>
 
<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#add_config-1">add_config/1</a></td><td>Add additional configuration elements at runtime.</td></tr>
<tr><td valign="top"><a href="#all_trace_off-0">all_trace_off/0</a></td><td>Turn Off ALL tracing.</td></tr>
<tr><td valign="top"><a href="#code_change-3">code_change/3</a></td><td></td></tr>
<tr><td valign="top"><a href="#get_config_value-1">get_config_value/1</a></td><td>Internal export.</td></tr>
<tr><td valign="top"><a href="#get_config_value-2">get_config_value/2</a></td><td>Internal export.</td></tr>
<tr><td valign="top"><a href="#get_metrics-0">get_metrics/0</a></td><td></td></tr>
<tr><td valign="top"><a href="#get_metrics-2">get_metrics/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#handle_call-3">handle_call/3</a></td><td></td></tr>
<tr><td valign="top"><a href="#handle_cast-2">handle_cast/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#handle_info-2">handle_info/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#init-1">init/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#rescan_config-0">rescan_config/0</a></td><td>Clear current configuration for ibrowse and load from the file
  ibrowse.conf in the IBROWSE_EBIN/../priv directory.</td></tr>
<tr><td valign="top"><a href="#rescan_config-1">rescan_config/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#send_req-3">send_req/3</a></td><td>This is the basic function to send a HTTP request.</td></tr>
<tr><td valign="top"><a href="#send_req-4">send_req/4</a></td><td>Same as send_req/3.</td></tr>
<tr><td valign="top"><a href="#send_req-5">send_req/5</a></td><td>Same as send_req/4.</td></tr>
<tr><td valign="top"><a href="#send_req-6">send_req/6</a></td><td>Same as send_req/5.</td></tr>
<tr><td valign="top"><a href="#send_req_direct-4">send_req_direct/4</a></td><td>Same as send_req/3 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2.</td></tr>
<tr><td valign="top"><a href="#send_req_direct-5">send_req_direct/5</a></td><td>Same as send_req/4 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2.</td></tr>
<tr><td valign="top"><a href="#send_req_direct-6">send_req_direct/6</a></td><td>Same as send_req/5 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2.</td></tr>
<tr><td valign="top"><a href="#send_req_direct-7">send_req_direct/7</a></td><td>Same as send_req/6 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2.</td></tr>
<tr><td valign="top"><a href="#set_dest-3">set_dest/3</a></td><td>Deprecated.</td></tr>
<tr><td valign="top"><a href="#set_max_attempts-3">set_max_attempts/3</a></td><td>Set the maximum attempts for each connection to a specific Host:Port.</td></tr>
<tr><td valign="top"><a href="#set_max_pipeline_size-3">set_max_pipeline_size/3</a></td><td>Set the maximum pipeline size for each connection to a specific Host:Port.</td></tr>
<tr><td valign="top"><a href="#set_max_sessions-3">set_max_sessions/3</a></td><td>Set the maximum number of connections allowed to a specific Host:Port.</td></tr>
<tr><td valign="top"><a href="#show_dest_status-0">show_dest_status/0</a></td><td>Shows some internal information about load balancing.</td></tr>
<tr><td valign="top"><a href="#show_dest_status-1">show_dest_status/1</a></td><td></td></tr>
<tr><td valign="top"><a href="#show_dest_status-2">show_dest_status/2</a></td><td>Shows some internal information about load balancing to a
  specified Host:Port.</td></tr>
<tr><td valign="top"><a href="#spawn_link_worker_process-1">spawn_link_worker_process/1</a></td><td>Same as spawn_worker_process/1 except the the calling process
  is linked to the worker process which is spawned.</td></tr>
<tr><td valign="top"><a href="#spawn_link_worker_process-2">spawn_link_worker_process/2</a></td><td>Same as spawn_link_worker_process/1 except with Erlang process options.</td></tr>
<tr><td valign="top"><a href="#spawn_worker_process-1">spawn_worker_process/1</a></td><td>Creates a HTTP client process to the specified Host:Port which
  is not part of the load balancing pool.</td></tr>
<tr><td valign="top"><a href="#spawn_worker_process-2">spawn_worker_process/2</a></td><td>Same as spawn_worker_process/1 except with Erlang process options.</td></tr>
<tr><td valign="top"><a href="#start-0">start/0</a></td><td>Starts the ibrowse process without linking.</td></tr>
<tr><td valign="top"><a href="#start_link-0">start_link/0</a></td><td>Starts the ibrowse process linked to the calling process.</td></tr>
<tr><td valign="top"><a href="#stop-0">stop/0</a></td><td>Stop the ibrowse process.</td></tr>
<tr><td valign="top"><a href="#stop_worker_process-1">stop_worker_process/1</a></td><td>Terminate a worker process spawned using
  spawn_worker_process/2 or spawn_link_worker_process/2.</td></tr>
<tr><td valign="top"><a href="#stream_close-1">stream_close/1</a></td><td>Tell ibrowse to close the connection associated with the
  specified stream.</td></tr>
<tr><td valign="top"><a href="#stream_next-1">stream_next/1</a></td><td>Tell ibrowse to stream the next chunk of data to the
  caller.</td></tr>
<tr><td valign="top"><a href="#terminate-2">terminate/2</a></td><td></td></tr>
<tr><td valign="top"><a href="#trace_off-0">trace_off/0</a></td><td>Turn tracing off for the ibrowse process.</td></tr>
<tr><td valign="top"><a href="#trace_off-2">trace_off/2</a></td><td>Turn tracing OFF for all connections to the specified HTTP
  server.</td></tr>
<tr><td valign="top"><a href="#trace_on-0">trace_on/0</a></td><td>Turn tracing on for the ibrowse process.</td></tr>
<tr><td valign="top"><a href="#trace_on-2">trace_on/2</a></td><td>Turn tracing on for all connections to the specified HTTP
  server.</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="add_config-1">add_config/1</a></h3>
<div class="spec">
<p><tt>add_config(Terms) -&gt; any()</tt></p>
</div><p>Add additional configuration elements at runtime.</p>

<h3 class="function"><a name="all_trace_off-0">all_trace_off/0</a></h3>
<div class="spec">
<p><tt>all_trace_off() -&gt; ok</tt><br></p>
</div><p>Turn Off ALL tracing</p>

<h3 class="function"><a name="code_change-3">code_change/3</a></h3>
<div class="spec">
<p><tt>code_change(OldVsn, State, Extra) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="get_config_value-1">get_config_value/1</a></h3>
<div class="spec">
<p><tt>get_config_value(Key) -&gt; any()</tt></p>
</div><p>Internal export</p>

<h3 class="function"><a name="get_config_value-2">get_config_value/2</a></h3>
<div class="spec">
<p><tt>get_config_value(Key, DefVal) -&gt; any()</tt></p>
</div><p>Internal export</p>

<h3 class="function"><a name="get_metrics-0">get_metrics/0</a></h3>
<div class="spec">
<p><tt>get_metrics() -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="get_metrics-2">get_metrics/2</a></h3>
<div class="spec">
<p><tt>get_metrics(Host, Port) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="handle_call-3">handle_call/3</a></h3>
<div class="spec">
<p><tt>handle_call(Request, From, State) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="handle_cast-2">handle_cast/2</a></h3>
<div class="spec">
<p><tt>handle_cast(Msg, State) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="handle_info-2">handle_info/2</a></h3>
<div class="spec">
<p><tt>handle_info(Info, State) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="init-1">init/1</a></h3>
<div class="spec">
<p><tt>init(X1) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="rescan_config-0">rescan_config/0</a></h3>
<div class="spec">
<p><tt>rescan_config() -&gt; any()</tt></p>
</div><p>Clear current configuration for ibrowse and load from the file
  ibrowse.conf in the IBROWSE_EBIN/../priv directory. Current
  configuration is cleared only if the ibrowse.conf file is readable
  using file:consult/1</p>

<h3 class="function"><a name="rescan_config-1">rescan_config/1</a></h3>
<div class="spec">
<p><tt>rescan_config(Terms) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="send_req-3">send_req/3</a></h3>
<div class="spec">
<p><tt>send_req(Url::string(), Headers::<a href="#type-headerList">headerList()</a>, Method::<a href="#type-method">method()</a>) -&gt; <a href="#type-response">response()</a></tt>
<ul class="definitions"><li><tt><a name="type-headerList">headerList()</a> = [{<a href="#type-header">header()</a>, <a href="#type-value">value()</a>}]</tt></li><li><tt><a name="type-header">header()</a> = atom() | string() | binary()</tt></li><li><tt><a name="type-value">value()</a> = term()</tt></li><li><tt><a name="type-method">method()</a> = get | post | head | options | put | delete | trace | mkcol | propfind | proppatch | lock | unlock | move | copy</tt></li><li><tt>Status = string()</tt></li><li><tt>ResponseHeaders = [<a href="#type-respHeader">respHeader()</a>]</tt></li><li><tt><a name="type-respHeader">respHeader()</a> = {<a href="#type-headerName">headerName()</a>, <a href="#type-headerValue">headerValue()</a>}</tt></li><li><tt><a name="type-headerName">headerName()</a> = string()</tt></li><li><tt><a name="type-headerValue">headerValue()</a> = string()</tt></li><li><tt><a name="type-response">response()</a> = {ok, Status, ResponseHeaders, ResponseBody} | {ibrowse_req_id, <a href="#type-req_id">req_id()</a>} | {error, Reason}</tt></li><li><tt><a name="type-req_id">req_id()</a> = term()</tt></li><li><tt>ResponseBody = string() | {file, Filename}</tt></li><li><tt>Reason = term()</tt></li></ul></p>
</div><p>This is the basic function to send a HTTP request.
  The Status return value indicates the HTTP status code returned by the webserver</p>

<h3 class="function"><a name="send_req-4">send_req/4</a></h3>
<div class="spec">
<p><tt>send_req(Url, Headers, Method::<a href="#type-method">method()</a>, Body::<a href="#type-body">body()</a>) -&gt; <a href="#type-response">response()</a></tt>
<ul class="definitions"><li><tt><a name="type-body">body()</a> = [] | string() | binary() | <a href="#type-fun_arity_0">fun_arity_0()</a> | {<a href="#type-fun_arity_1">fun_arity_1()</a>, <a href="#type-initial_state">initial_state()</a>}</tt></li><li><tt><a name="type-initial_state">initial_state()</a> = term()</tt></li></ul></p>
</div><p>Same as send_req/3.
  If a list is specified for the body it has to be a flat list. The body can also be a fun/0 or a fun/1. <br>
  If fun/0, the connection handling process will repeatdely call the fun until it returns an error or eof. <pre>Fun() = {ok, Data} | eof</pre><br>
  If fun/1, the connection handling process will repeatedly call the fun with the supplied state until it returns an error or eof. <pre>Fun(State) = {ok, Data} | {ok, Data, NewState} | eof</pre></p>

<h3 class="function"><a name="send_req-5">send_req/5</a></h3>
<div class="spec">
<p><tt>send_req(Url::string(), Headers::<a href="#type-headerList">headerList()</a>, Method::<a href="#type-method">method()</a>, Body::<a href="#type-body">body()</a>, Options::<a href="#type-optionList">optionList()</a>) -&gt; <a href="#type-response">response()</a></tt>
<ul class="definitions"><li><tt><a name="type-optionList">optionList()</a> = [<a href="#type-option">option()</a>]</tt></li><li><tt><a name="type-option">option()</a> = {max_sessions, integer()} | {response_format, <a href="#type-response_format">response_format()</a>} | {stream_full_chunks, boolean()} | {stream_chunk_size, integer()} | {max_pipeline_size, integer()} | {trace, boolean()} | {is_ssl, boolean()} | {ssl_options, [SSLOpt]} | {pool_name, atom()} | {proxy_host, string()} | {proxy_port, integer()} | {proxy_user, string()} | {proxy_password, string()} | {use_absolute_uri, boolean()} | {basic_auth, {<a href="#type-username">username()</a>, <a href="#type-password">password()</a>}} | {cookie, string()} | {content_length, integer()} | {content_type, string()} | {save_response_to_file, <a href="#type-srtf">srtf()</a>} | {stream_to, <a href="#type-stream_to">stream_to()</a>} | {http_vsn, {MajorVsn, MinorVsn}} | {host_header, string()} | {inactivity_timeout, integer()} | {connect_timeout, integer()} | {socket_options, Sock_opts} | {transfer_encoding, {chunked, ChunkSize}} | {headers_as_is, boolean()} | {give_raw_headers, boolean()} | {preserve_chunked_encoding, boolean()} | {workaround, head_response_with_body} | {worker_process_options, list()} | {return_raw_request, true} | {max_attempts, integer()}</tt></li><li><tt><a name="type-stream_to">stream_to()</a> = <a href="#type-process">process()</a> | {<a href="#type-process">process()</a>, once}</tt></li><li><tt><a name="type-process">process()</a> = pid() | atom()</tt></li><li><tt><a name="type-username">username()</a> = string()</tt></li><li><tt><a name="type-password">password()</a> = string()</tt></li><li><tt>SSLOpt = term()</tt></li><li><tt>Sock_opts = [Sock_opt]</tt></li><li><tt>Sock_opt = term()</tt></li><li><tt>ChunkSize = integer()</tt></li><li><tt><a name="type-srtf">srtf()</a> = boolean() | <a href="#type-filename">filename()</a> | {append, <a href="#type-filename">filename()</a>}</tt></li><li><tt><a name="type-filename">filename()</a> = string()</tt></li><li><tt><a name="type-response_format">response_format()</a> = list | binary</tt></li></ul></p>
</div><p>Same as send_req/4.</p>

<h3 class="function"><a name="send_req-6">send_req/6</a></h3>
<div class="spec">
<p><tt>send_req(Url, Headers::<a href="#type-headerList">headerList()</a>, Method::<a href="#type-method">method()</a>, Body::<a href="#type-body">body()</a>, Options::<a href="#type-optionList">optionList()</a>, Timeout) -&gt; <a href="#type-response">response()</a></tt>
<ul class="definitions"><li><tt>Timeout = integer() | infinity</tt></li></ul></p>
</div><p>Same as send_req/5.
  All timeout values are in milliseconds.</p>

<h3 class="function"><a name="send_req_direct-4">send_req_direct/4</a></h3>
<div class="spec">
<p><tt>send_req_direct(Conn_pid, Url, Headers, Method) -&gt; any()</tt></p>
</div><p>Same as send_req/3 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2</p>

<h3 class="function"><a name="send_req_direct-5">send_req_direct/5</a></h3>
<div class="spec">
<p><tt>send_req_direct(Conn_pid, Url, Headers, Method, Body) -&gt; any()</tt></p>
</div><p>Same as send_req/4 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2</p>

<h3 class="function"><a name="send_req_direct-6">send_req_direct/6</a></h3>
<div class="spec">
<p><tt>send_req_direct(Conn_pid, Url, Headers, Method, Body, Options) -&gt; any()</tt></p>
</div><p>Same as send_req/5 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2</p>

<h3 class="function"><a name="send_req_direct-7">send_req_direct/7</a></h3>
<div class="spec">
<p><tt>send_req_direct(Conn_pid, Url, Headers, Method, Body, Options, Timeout) -&gt; any()</tt></p>
</div><p>Same as send_req/6 except that the first argument is the PID
  returned by spawn_worker_process/2 or spawn_link_worker_process/2</p>

<h3 class="function"><a name="set_dest-3">set_dest/3</a></h3>
<div class="spec">
<p><tt>set_dest(Host, Port, T) -&gt; any()</tt></p>
</div><p>Deprecated. Use set_max_sessions/3 and set_max_pipeline_size/3
  for achieving the same effect.</p>

<h3 class="function"><a name="set_max_attempts-3">set_max_attempts/3</a></h3>
<div class="spec">
<p><tt>set_max_attempts(Host::string(), Port::integer(), Max::integer()) -&gt; ok</tt><br></p>
</div><p>Set the maximum attempts for each connection to a specific Host:Port.</p>

<h3 class="function"><a name="set_max_pipeline_size-3">set_max_pipeline_size/3</a></h3>
<div class="spec">
<p><tt>set_max_pipeline_size(Host::string(), Port::integer(), Max::integer()) -&gt; ok</tt><br></p>
</div><p>Set the maximum pipeline size for each connection to a specific Host:Port.</p>

<h3 class="function"><a name="set_max_sessions-3">set_max_sessions/3</a></h3>
<div class="spec">
<p><tt>set_max_sessions(Host::string(), Port::integer(), Max::integer()) -&gt; ok</tt><br></p>
</div><p>Set the maximum number of connections allowed to a specific Host:Port.</p>

<h3 class="function"><a name="show_dest_status-0">show_dest_status/0</a></h3>
<div class="spec">
<p><tt>show_dest_status() -&gt; any()</tt></p>
</div><p>Shows some internal information about load balancing. Info
  about workers spawned using spawn_worker_process/2 or
  spawn_link_worker_process/2 is not included.</p>

<h3 class="function"><a name="show_dest_status-1">show_dest_status/1</a></h3>
<div class="spec">
<p><tt>show_dest_status(Url) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="show_dest_status-2">show_dest_status/2</a></h3>
<div class="spec">
<p><tt>show_dest_status(Host, Port) -&gt; any()</tt></p>
</div><p>Shows some internal information about load balancing to a
  specified Host:Port. Info about workers spawned using
  spawn_worker_process/2 or spawn_link_worker_process/2 is not
  included.</p>

<h3 class="function"><a name="spawn_link_worker_process-1">spawn_link_worker_process/1</a></h3>
<div class="spec">
<p><tt>spawn_link_worker_process(Url::string() | {Host::string(), Port::integer()}) -&gt; {ok, pid()}</tt><br></p>
</div><p>Same as spawn_worker_process/1 except the the calling process
  is linked to the worker process which is spawned.</p>

<h3 class="function"><a name="spawn_link_worker_process-2">spawn_link_worker_process/2</a></h3>
<div class="spec">
<p><tt>spawn_link_worker_process(Host::string(), Port::integer()) -&gt; {ok, pid()}</tt><br></p>
</div><p>Same as spawn_link_worker_process/1 except with Erlang process options.</p>

<h3 class="function"><a name="spawn_worker_process-1">spawn_worker_process/1</a></h3>
<div class="spec">
<p><tt>spawn_worker_process(Url::string() | {Host::string(), Port::integer()}) -&gt; {ok, pid()}</tt><br></p>
</div><p>Creates a HTTP client process to the specified Host:Port which
  is not part of the load balancing pool. This is useful in cases
  where some requests to a webserver might take a long time whereas
  some might take a very short time. To avoid getting these quick
  requests stuck in the pipeline behind time consuming requests, use
  this function to get a handle to a connection process. <br>
  <b>Note:</b> Calling this function only creates a worker process. No connection
  is setup. The connection attempt is made only when the first
  request is sent via any of the send_req_direct/4,5,6,7 functions.<br>
  <b>Note:</b> It is the responsibility of the calling process to control
  pipeline size on such connections.</p>

<h3 class="function"><a name="spawn_worker_process-2">spawn_worker_process/2</a></h3>
<div class="spec">
<p><tt>spawn_worker_process(Host::string(), Port::integer()) -&gt; {ok, pid()}</tt><br></p>
</div><p>Same as spawn_worker_process/1 except with Erlang process options.</p>

<h3 class="function"><a name="start-0">start/0</a></h3>
<div class="spec">
<p><tt>start() -&gt; any()</tt></p>
</div><p>Starts the ibrowse process without linking. Useful when testing using the shell</p>

<h3 class="function"><a name="start_link-0">start_link/0</a></h3>
<div class="spec">
<p><tt>start_link() -&gt; {ok, pid()}</tt><br></p>
</div><p>Starts the ibrowse process linked to the calling process. Usually invoked by the supervisor ibrowse_sup</p>

<h3 class="function"><a name="stop-0">stop/0</a></h3>
<div class="spec">
<p><tt>stop() -&gt; any()</tt></p>
</div><p>Stop the ibrowse process. Useful when testing using the shell.</p>

<h3 class="function"><a name="stop_worker_process-1">stop_worker_process/1</a></h3>
<div class="spec">
<p><tt>stop_worker_process(Conn_pid::pid()) -&gt; ok</tt><br></p>
</div><p>Terminate a worker process spawned using
  spawn_worker_process/2 or spawn_link_worker_process/2. Requests in
  progress will get the error response <pre>{error, closing_on_request}</pre></p>

<h3 class="function"><a name="stream_close-1">stream_close/1</a></h3>
<div class="spec">
<p><tt>stream_close(Req_id::<a href="#type-req_id">req_id()</a>) -&gt; ok | {error, unknown_req_id}</tt><br></p>
</div><p>Tell ibrowse to close the connection associated with the
  specified stream.  Should be used in conjunction with the
  <code>stream_to</code> option. Note that all requests in progress on
  the connection which is serving this Req_id will be aborted, and an
  error returned.</p>

<h3 class="function"><a name="stream_next-1">stream_next/1</a></h3>
<div class="spec">
<p><tt>stream_next(Req_id::<a href="#type-req_id">req_id()</a>) -&gt; ok | {error, unknown_req_id}</tt><br></p>
</div><p>Tell ibrowse to stream the next chunk of data to the
  caller. Should be used in conjunction with the
  <code>stream_to</code> option</p>

<h3 class="function"><a name="terminate-2">terminate/2</a></h3>
<div class="spec">
<p><tt>terminate(Reason, State) -&gt; any()</tt></p>
</div>

<h3 class="function"><a name="trace_off-0">trace_off/0</a></h3>
<div class="spec">
<p><tt>trace_off() -&gt; any()</tt></p>
</div><p>Turn tracing off for the ibrowse process</p>

<h3 class="function"><a name="trace_off-2">trace_off/2</a></h3>
<div class="spec">
<p><tt>trace_off(Host, Port) -&gt; ok</tt><br></p>
</div><p>Turn tracing OFF for all connections to the specified HTTP
  server.</p>

<h3 class="function"><a name="trace_on-0">trace_on/0</a></h3>
<div class="spec">
<p><tt>trace_on() -&gt; any()</tt></p>
</div><p>Turn tracing on for the ibrowse process</p>

<h3 class="function"><a name="trace_on-2">trace_on/2</a></h3>
<div class="spec">
<p><tt>trace_on(Host, Port) -&gt; ok</tt>
<ul class="definitions"><li><tt>Host = string()</tt></li><li><tt>Port = integer()</tt></li></ul></p>
</div><p>Turn tracing on for all connections to the specified HTTP
  server. Host is whatever is specified as the domain name in the URL</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Nov 6 2015, 11:40:24.</i></p>
</body>
</html>
